<?php
Route::get('/', 'WelcomeController@index');
Route::post('upimg', 'CommonController@upload');
Route::get('img/{dir}-{id}/{width?}-{height?}-{upsize?}', 'CommonController@img');
Route::any('laravel-u-editor-server/server', 'caonimaController@server');
Route::controllers(['auth/logout' => 'Admin\AuthController']);
Route::controllers([
	'auth' => 'Auth\AuthController',
	'password' => 'Auth\PasswordController',
]);

//后台登录处理
Route::controllers(['admin/auth' => 'Admin\AuthController']);
Route::group(['middleware' => ['adminAuth'], 'prefix' => 'admin', 'namespace' => 'Admin'], function () {
    Route::controllers([
        'sys'   => 'SysController',
        'user'   => 'UserController',
        'news'  => 'NewsController',
        'active'=> 'ActiveController',
        'member'=> 'MemberController',
        'product'=> 'ProductController',
        'his'   => 'HisController',
        '/'      => 'AdminController'
    ]);
});

//门店后台
Route::group(['middleware' => ['merchant'], 'prefix' => 'merchant', 'namespace' => 'Merchant'], function () {
    Route::controllers([
        'sys'       => 'SysController',
        'product'   => 'ProductController',
        '/'          => 'MerchantController'
    ]);
});

//前台
Route::group(['prefix' => '', 'namespace' => 'site'], function () {
    Route::get('/', 'IndexController@index');
    Route::get('index', 'IndexController@index');
    Route::controllers([
        'house'      => 'HouseController',//快房
        'car'        => 'CarController',//快车
        'work'       => 'WorkController',//快工
        'marriage'  => 'MarriageController',//快婚
        'business'  => 'BusinessController',//快商
        'decorate'  => 'IndexController', //装修
        '/'          => 'IndexController'
    ]);
});